package cn.cjlmonster.demo02.ui;

import android.widget.SeekBar;

import cn.cjlmonster.demo02.R;
import cn.cjlmonster.demo02.base.BaseAppCompatActivity;
import cn.cjlmonster.demo02.widget.RingGradientView;

/**
 * cn.cjlmonster.demo02.ui
 *
 * @author cjl
 * @project Demo02
 * @date 2021/12/22 9:01 下午
 */
public class RingGradientActivity extends BaseAppCompatActivity {

    @Override
    protected int getLayoutId() {
        return R.layout.activity_ring_gradient;
    }

    @Override
    protected boolean canBack() {
        return true;
    }

    private RingGradientView ring;
    private SeekBar bar;

    @Override
    protected void initView() {
        ring = findViewById(R.id.ring);
        bar = findViewById(R.id.bar);
    }

    @Override
    protected void initEvents() {
        bar.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {
            @Override
            public void onProgressChanged(SeekBar seekBar, int i, boolean b) {
                ring.setColor(i);
            }

            @Override
            public void onStartTrackingTouch(SeekBar seekBar) {

            }

            @Override
            public void onStopTrackingTouch(SeekBar seekBar) {

            }
        });
    }
}
